<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
    <div id="app"></div>
</body>

<script>
    Vue.createApp({
        data(){
            return{
                content:'',
                setMeal:'显示',
                isshow:false
            }
        },
        methods:{
            welcome(){
                this.content = '欢迎光临'
            },
            bye(){
                this.content = '再见啦'
            },
            show(){
                this.isshow = !this.isshow
            }
        },
        template:`<div>
            <div>{{content}}</div>
            <button v-on:click="welcome">来</button>
            <button v-on:click="bye">离开</button>
            <div>
                <div v-if="isshow">{{setMeal}}</div>
                <button v-on:click="show">显示/隐藏</button>    
            </div>
            </div>`
    }).mount('#app')
</script>
</html>